/**
 * @file
 * @brief This file contains the demo context abstraction for the demolib API.
 */

#ifndef NOSAL_DEMOLIB_CONTEXT_H_
#define NOSAL_DEMOLIB_CONTEXT_H_

#include <atomic>

#include "nosal/demolib/common.h"
#include "nosal/demolib/internal/utility.h"

namespace netaos {
namespace nosal {
namespace demo {
namespace lib {

class Context final {
  public:
    /**
     * @brief Creates a @c Context object.
     */
    Context(std::string context_id, std::string description);

    ~Context();

    Context(const Context &) = delete;
    Context &operator=(const Context &) = delete;
    Context(Context &&) = delete;
    Context &operator=(Context &&) = delete;

    bool IsEnabled() const noexcept;

    void Enable(bool enable) noexcept;

  private:
    std::atomic<bool> is_enabled_{false};
    std::string       context_id_;
    std::string       description_;
};

} /* namespace lib */
} /* namespace demo */
} /* namespace nosal */
} /* namespace netaos */

#endif  // NOSAL_DEMOLIB_CONTEXT_H_
